<?php

namespace App\Http\Requests\Personal\ModPassword;
use App\Http\Requests\Request;

class ModPasswordRequest extends Request {
    public function authorize(){
        return true;
    }
    public function rules(){
        $input = $this->all();
        return [
            'oldpassword' => 'required|check_oldpass:'.$this->input('uid'),
            'password' => 'required|confirmed',
        ];
    }
    public function messages(){
        return [
            'oldpassword.required' => '旧密码必须填写',
            'oldpassword.check_oldpass' => '旧密码不正确',
            'password.required' => '新密码必须填写',
            'password.confirmed' => '确认密码和新密码必须一致',
        ];
    }
}